package com.whcoding.designpatterns.pattern.strategy;

/**
 * @program: spring-boot-learning
 * @description: 抽象策略角色：
 * @author: whcoding
 * @create: 2022-09-20 19:59
 **/
public abstract class AbstractDiscountStrategy {

	/**
	 * 价格
	 */
	private double price = 0;

	/**
	 * 数量
	 */
	private int copies;

	/**
	 * 无参构造
	 */
	public AbstractDiscountStrategy() {
	}

	/**
	 * 有参构造
	 */
	public AbstractDiscountStrategy(double price, int copies) {
		this.price = price;
		this.copies = copies;
	}


	/**
	 * 计算价格的策略方法
	 *
	 * @return
	 */
	abstract double calcDiscount();

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public int getCopies() {
		return copies;
	}

	public void setCopies(int copies) {
		this.copies = copies;
	}
}
